/**
* All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
*
* PmContractServiceAuto
* 项目合同
*
* 修改纪录
* 2020-05-18 版本：1.0 wushenghong 创建。
* @version 版本：1.0
* @author 作者：wushenghong
* 创建日期：2020-05-18
*/

package com.topscomm.pm.service.impl.auto;

import com.topscomm.basic.IBasicDao;
import com.topscomm.pm.PmService;
import com.topscomm.pm.dao.IPmContractDao;
import com.topscomm.pm.pojo.PmContractEntity;
import com.topscomm.tap.common.DatacodeCache;

import javax.annotation.Resource;
import java.util.Map;


public class PmContractServiceAuto extends PmService<PmContractEntity,IPmContractDao> {

	/**
	 * @author: wushenghong
	 * @date: 2020-05-18
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify:
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("projectid") != null) {
			temp = mapRow.get("projectid").toString();
			mapRow.put("dispprojectid", datacodeCache.getValueDynamic("PmProject", temp, "id", "name"));
		}
		if (mapRow.get("courier") != null) {
			temp = mapRow.get("courier").toString();
			mapRow.put("dispcourier", datacodeCache.getValueDynamic("PmCourier", temp, "code", "name"));
		}
		if (mapRow.get("flowid") != null) {
			temp = mapRow.get("flowid").toString();
			mapRow.put("dispflowid", datacodeCache.getValueDynamic("ApprovalFlow_PmContract", temp, "id", "name"));
		}
		if (mapRow.get("state") != null) {
			temp = mapRow.get("state").toString();
			mapRow.put("dispstate", datacodeCache.getValueDynamic("TapApprovalBillState", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("paytype") != null) {
			temp = mapRow.get("paytype").toString();
			mapRow.put("disppaytype", datacodeCache.getValueDynamic("PmContractPayType", temp, "code", "name"));
		}
	}

	@Override
	@Resource(name = "pmContractDao")
	public void setDao(IBasicDao<PmContractEntity> dao) {
		super.setDao(dao);
	}
}
